// src/api/captchaApi.js
import request from '../utils/request';

const captchaApi = {
  /**
   * 生成验证码
   * @returns {Promise} 返回验证码ID和图片数据
   */
  generateCaptcha: () => request({
    url: '/api/captcha/generate',
    method: 'get'
  }),

  /**
   * 验证验证码
   * @param {Object} captchaData - 验证码数据
   * @param {string} captchaData.captchaId - 验证码ID
   * @param {string} captchaData.captchaCode - 验证码
   * @returns {Promise} 返回验证结果
   */
  verifyCaptcha: (captchaData) => request({
    url: '/api/captcha/verify',
    method: 'post',
    data: captchaData
  })
};

export default captchaApi;
